Copyright: CreateHelp! {Unregisterd} ® Nic Barnes 1993


Overview

Charlie - Data Dictionary Manager

Charlie is a data dictionary manager to control the DD of a microsoft accell database, as it is used with Visual Basic 3.0. Charlie allow you to change your dictionary in the following way's

Change / Delete and Add of :

Tables

Query definitions

Fields

Indexes

References

The Change/Add and Delete buttons work for the item from the above list on which you last clicked. This means, if you want to add  a field to a table : Click the table, then click on the fields list and then press the Add-button.

Furthermore you can print the DDL of your database, compress or repair your database, make a new -  or delete an old -database.

Contents :

1. Tables Change, Add and Delete Tables

2. Query Definitions  Change, Add and Delete Query definitions

3. Fields Change, Add and delete Fields

4. Indexes Change, Add and Delete Indexes

5. References Chage, Add and Delete references


Tables

You can Add, Delete and Change Tables.

If you add a new table it will be made available with a field called dummy in your database. This is necessary, since Access does not accept empty tables.

You will have to give your new table a name of max 40 characters, that is not being used already for a table.

Of course, the table can be manipulated only after you opened a database (or created a new one).

Take care if you delete a Table. All its contents, references, indexes etc. will be deleted. Any Querydefs that referenced that table will be invalid !

Changing a table, means change its name. This might have consequnces for Query definitions, which reference the table. Also the references to the table will be void.


Query definitions

You can Add, Change and Delete Query definitions in your database.

Before a query will be added to your database, it will be checked on correct syntax. Should it not conform to Microsoft SQL, it will be refused.

If you change querys, you will be given the option to change in place (just simple update), or to copy to a new location. The latter, under a new name of course, should be used with preference. You always can delete a query afterwards. But if you update in place, and the new definition does not produce the correct result, the old one will be lost.

The Name of a query can be changed without any consequences in the Database. But your program, or other - referencing - querys may rest invalid.


Fields

The fields, which constitute the tables of the database, can also be changed, added and deleted from the database. If you change the properties of a field, it will have consequences for its contents (if any).

For a field you will give :

Name	-	The Name of a field might be up to 40 Characters long.

It will be used in your programs, SQL statements etc. so

changing it will normally not be done. To avoid misunder-

standings, you are advised to give each field a different name,

if its contents is different.

Type	-	The type of data in the field. You can select one of the

available data types under VB (Access) by clicking in the

list. If you choose a text field (Default), you can also give :

Length	-	the Length of a text field (max 255 positions)

AutoInc.	-	If the filed type is Long-Integer, you can define the field as

an autoincrementing field. It will be filled by the access engine

with an automatic increnmenting number for each new record.

Collating S.	-	Here you can give (select from a list) one of the available

collating sequences that are recognized by VB. This will only

be available for fields that contain text.

If you delete a field, all of its contents will also be deleted.

If you change a field, and you change the type of field a conversion of the data in the database for this field will be tryd to the best possible.

F.i.

Type   ->  	Type	Conversion

Integer	Text	The number will be converted to text

Text 	Integer	The numeric part will be converted to an integer

the letters will be lost !

Bool	Text	a -1 will be translated to True and a 0 (False) to

the word False

Date	Text	The Date will converted, following the windows long-

date format as per your settings to a string

Also some conversions are not possible. (f.i. Date -> Bool), in those case all your data from this field will be lost. So TAKE CARE !!!!!!


Indexes

Indexes can be deleted, added and Changed for each individual table in the database.

By clicking on the + / - signs before a field name you can change the order of that filed in the index. (Ascending, descending). You select /deselect fields for an index by clicking on them. The sequence of the fields can be altered in the change index function. By moving fields between selected and available (using the 2 buttons) you can freely compose a key exactly as you want him.

Furthermore you can indicate if a key is a primary key, and if it will contain unique values. The latter is Necessary for the : 1 side of the references you can define between tables.

You can define a maximum of 10 indexes per table. Per index you can have maximal 10 fields.

If you change the name of an index, take care that your references and/or SQLs will not be made invalid


References

You can define references between tables in your database. With charlie you can also change and delete them. Since Ms does not give access to its access-jet engine system tables for VB programs, we where forced to emulate the data about references in our own tables. So we will generate a small table (You will not see it in Charlie) which will contain all data about references.

This means that the change and delete function only works for references that are created with Charlie. Other references will not be seen by Charlie!

The table Charlie generates is called MCSysRefs, it contains one record for each reference you define.

ReferenceName	The name of the reference.

Fields	The fields from the source (referencing) table which

constitute the reference. The data types of the

referencing fields must match those of the referenced fields.

ReferencedTable	The name of the referenced (target) Table. You can select

by clicking on its name. Then it will automatic display a list

of its fields under the target fields.

Referenced Fields	From these fields you can select those you want to match the

fields in the selection of the source table. Between these fields

the relation specified below will be controlled by the engine.

Relation	You can specify if the relation is ;

1 : 1 Each single key in the source has one single target.

N : 1 Each value of a key in the source has a corresponding

value in the Target

You cannot create a relationship with the same referenced table, referenced fields, referencing table, and referencing fields.

You cannot create a relationship on Memo or OLE object fields.


references - References are relations between tables. They are managed by the access engine. They relate 2 tables via 1 or more fileds with simular type and size attributes.